package edu.scau.mis.pos.domain;

import cn.hutool.core.annotation.Alias;
import edu.scau.mis.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.List;

//某个类加上该注解就是说把这个类交给Spring管理。那么该类的实例化new Category()就由Spring完成
@Component
@ApiModel(value="类别")
public class Category extends BaseEntity {
    @ApiModelProperty(value="类别编号")
    @Alias("编号")
    private Long categoryId;
    @ApiModelProperty(value="类别名称")
    @Alias("类别名称")
    private String categoryName;

    @ApiModelProperty(value="是否删除")
    @Alias("逻辑删除")
    private int display;

    public int getDisplay() {
        return display;
    }

    public void setDisplay(int display) {
        this.display = display;
    }
//    private List<ProductDescription> productDescription;
//
//    public List<ProductDescription> getProductDescription() {
//        return productDescription;
//    }
//
//    public void setProductDescription(List<ProductDescription> productDescription) {
//        this.productDescription = productDescription;
//    }

    public Category(){}

    public Category(Long categoryId, String categoryName, int display) {
        this.categoryId = categoryId;
        this.categoryName = categoryName;
        this.display = display;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    @Override
    public String toString() {
        return "Category{" +
                "categoryId=" + categoryId +
                ", categoryName='" + categoryName + '\'' +
                ", display=" + display +
                '}';
    }
}
